package com.dmai.capacity.platform.oauth.common.service.impl;

import com.dmai.capacity.platform.common.model.OauthUser;
import com.dmai.capacity.platform.oauth.common.mapper.OauthUserDao;
import com.dmai.capacity.platform.oauth.common.service.IOauthUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;


@Service
public class OauthUserServiceImpl implements IOauthUserService {

    @Autowired
    private OauthUserDao oauthUserDao;

    /**
     * 添加
     *
     * @param oauthUser
     */
    @Override
    public int save(OauthUser oauthUser) {
        oauthUser.setUpdateTime(new Date());
        return oauthUserDao.save(oauthUser);
    }

    /**
     * 修改
     *
     * @param oauthUser
     */
    @Override
    public int update(OauthUser oauthUser) {
        oauthUser.setUpdateTime(new Date());
        return oauthUserDao.update(oauthUser);
    }


    /**
     * 删除
     *
     * @param id
     */
    @Override
    public int delete(String id) {
        return oauthUserDao.delete(id);
    }

    /**
     * 查询记录
     *
     * @param id
     * @return
     */
    @Override
    public OauthUser findById(String id) {
        OauthUser user = oauthUserDao.findById(id);
        return user;
    }
}
